﻿using System.Collections.Generic;
using UnityEngine;


public class Plant1 : MonoBehaviour {
    public float speedAttack = 2f;

    public Transform Bullet;

    //枪口
    private Transform gun;

    private void Awake()
    {
        gun = transform.Find("Gun").transform;
        


        InvokeRepeating("Attack", 0, speedAttack);
    }

    //攻击
    void Attack()
    {
        Transform buttle = Instantiate<Transform>(Bullet);
        buttle.SetParent(gun);
        buttle.localPosition = Vector3.zero;
        
    }
}
